package com.sltx.service.impl;




import com.sltx.dao.aaa.QlqyMapper;
import com.sltx.service.QlqyService;
import com.sltx.util.PageData;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.ArrayList;
import java.util.List;
import java.util.Map;

@Service
public class QlqyServiceImpl implements QlqyService {

    @Autowired
    private QlqyMapper qlqyMapper;


    @Override
    public int getQlqyByNameNum(PageData pd) {
        return qlqyMapper.getQlqyByNameNum(pd);
    }

    @Override
    public List<Object> getQlqyByName(PageData pd) {
        List<Object> result = new ArrayList<>();
        List<Map<String,Object>> list = qlqyMapper.getQlqyByName(pd);
        for (Map m : list){
            if("季度".equals(pd.get("update_quarterly"))){
                m.put("update_year",m.get("update_quarterly"));
            }
            result.add(m);
        }
        return result;
    }

    ////查询最新年份季度
    @Override
    public List<Map<String, Object>> getQlqyListnew(PageData pd) {
      return qlqyMapper.getQlqyListnew(pd);
    }



    //获取最大季度
    @Override
    public String bigQuarter() {
        return qlqyMapper.bigQuarter();
    }

    //获取条数
    @Override
    public int getNum4(PageData pd) {
       return qlqyMapper.getNum4(pd);

    }

    @Override
    public Map<String, Object> getYearandquarterlt(PageData pd) {
        return qlqyMapper.getYearandquarterlt(pd);
    }
}
